package com.example.controller;


import com.alibaba.fastjson.JSONObject;
import com.example.common.Result;
import com.example.entity.HnyyWnPermission;
import com.example.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/permission")
public class PermissionController {
    @Autowired
    PermissionService permissionService;
    @PostMapping("/add")
    public Result add(@RequestBody HnyyWnPermission permission){
        int add = permissionService.add(permission);
        if (add == 0) {
            return Result.error("添加失败");
        }
        return Result.ok();
    }
}
